<?php

namespace common\model;

use think\model\RelationModel;

class UrgeMessageMemberModel extends RelationModel
{
    //自动验证
    protected $_validate = [
        ['urge_message_id', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT],//必须字段
        ['user_id', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT],//必须字段
        ['is_read', [0, 1], '', self::EXISTS_VALIDATE, 'in'],
        ['is_sender', [0, 1], '', self::EXISTS_VALIDATE, 'in'],
        ['is_delete', [0, 1], '', self::EXISTS_VALIDATE, 'in'],
        ['param', '', '', self::EXISTS_VALIDATE, 'array'],
    ];

    // 自动完成
    protected $_auto = [
        ['created', 'time', self::MODEL_INSERT, 'function'],
        ['param', 'json_encode', self::EXISTS_VALIDATE, 'function']
    ];
}
